Content prioritization based on packet size

ABSTRACT

In one embodiment, a method includes determining one or more bandwidth constraints on a bandwidth of a communication channel available to a first computing device; determining a plurality of data items to transmit from the first computing device; ranking each data item based at least in part on an affinity between a user and an originator of the data item in a social-networking system; selecting, based at least in part on the ranking of the data items, one or more particular ones of the data items to transmit from the first computing device from the first computing device; and writing the particular ones of the data items to a queue for subsequent transmission.

PRIORITY

This application is a continuation under 35 U.S.C. § 120 of U.S. patentapplication Ser. No. 13/618,710, filed 14 Sep. 2012.

TECHNICAL FIELD

This disclosure generally relates to mobile computing devices.

BACKGROUND

A mobile computing device—such as a smartphone, tablet computer, orlaptop computer—may include functionality for determining its location,direction, or orientation, such as a GPS receiver, compass, orgyroscope. Such a device may also include functionality for wirelesscommunication, such as BLUETOOTH communication, near-field communication(NFC), or infrared (IR) communication or communication with a wirelesslocal area networks (WLANs) or cellular-telephone network. Such a devicemay also include one or more cameras, scanners, touch screens,microphones, or speakers. Mobile computing devices may also executesoftware applications, such as games, web browsers, or social-networkingapplications. With social-networking applications, users may connect,communicate, and share information with other users in their socialnetworks.

SUMMARY OF PARTICULAR EMBODIMENTS

In particular embodiments, a client (which may be a mobile computingdevice) may communicate with a server (which may be a server in asocial-networking system). The mobile device may send data in the formof packets to the server, and the server may send data in the form ofpackets to the mobile device. A process running on a first computingdevice (e.g. the server or the mobile device) may determine how totransmit data packets to a second computing device (e.g. the mobiledevice or the server). The first computing device may determine a numberof data packets to transmit based, for example, on bandwidth or batteryconstraints. Each of the data packets may have a payload with a givenpayload capacity (e.g. a fixed size in bytes). The first computingdevice may determine outgoing data items for transmission to the secondcomputing device and rank them, for example, based on the relativeimportance of the data in them (which may in part be determined by adata prioritization set by the social-networking system). Based at leastin part on the ranking of the data items and the payload capacities ofthe data packets, the first computing device may select particular dataitems for transmission from the first computing device to the secondcomputing device in the data packets.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example network environment associated with asocial-networking system.

FIG. 2 illustrates an example social graph.

FIG. 3 illustrates an example client system.

FIG. 4 illustrates an example computing platform of a mobile device.

FIG. 5 illustrates an example method for transmitting data packets.

FIG. 6 illustrates an example computer system.

DESCRIPTION OF EXAMPLE EMBODIMENTS

FIG. 1 illustrates an example network environment 100 associated with asocial-networking system. Network environment 100 includes a clientsystem 130, a social-networking system 160, and a third-party system 170connected to each other by a network 110. Although FIG. 1 illustrates aparticular arrangement of client system 130, social-networking system160, third-party system 170, and network 110, this disclosurecontemplates any suitable arrangement of client system 130,social-networking system 160, third-party system 170, and network 110.As an example and not by way of limitation, two or more of client system130, social-networking system 160, and third-party system 170 may beconnected to each other directly, bypassing network 110. As anotherexample, two or more of client system 130, social-networking system 160,and third-party system 170 may be physically or logically co-locatedwith each other in whole or in part. Moreover, although FIG. 1illustrates a particular number of client systems 130, social-networkingsystems 160, third-party systems 170, and networks 110, this disclosurecontemplates any suitable number of client systems 130,social-networking systems 160, third-party systems 170, and networks110. As an example and not by way of limitation, network environment 100may include multiple client system 130, social-networking systems 160,third-party systems 170, and networks 110.

This disclosure contemplates any suitable network 110. As an example andnot by way of limitation, one or more portions of network 110 mayinclude an ad hoc network, an intranet, an extranet, a virtual privatenetwork (VPN), a local area network (LAN), a wireless LAN (WLAN), a widearea network (WAN), a wireless WAN (WWAN), a metropolitan area network(MAN), a portion of the Internet, a portion of the Public SwitchedTelephone Network (PSTN), a cellular telephone network, or a combinationof two or more of these. Network 110 may include one or more networks110.

Links 150 may connect client system 130, social-networking system 160,and third-party system 170 to communication network 110 or to eachother. This disclosure contemplates any suitable links 150. Inparticular embodiments, one or more links 150 include one or morewireline (such as for example Digital Subscriber Line (DSL) or Data OverCable Service Interface Specification (DOCSIS)), wireless (such as forexample Wi-Fi or Worldwide Interoperability for Microwave Access(WiMAX)), or optical (such as for example Synchronous Optical Network(SONET) or Synchronous Digital Hierarchy (SDH)) links. In particularembodiments, one or more links 150 each include an ad hoc network, anintranet, an extranet, a VPN, a LAN, a WLAN, a WAN, a WWAN, a MAN, aportion of the Internet, a portion of the PSTN, a cellulartechnology-based network, a satellite communications technology-basednetwork, another link 150, or a combination of two or more such links150. Links 150 need not necessarily be the same throughout networkenvironment 100. One or more first links 150 may differ in one or morerespects from one or more second links 150.

In particular embodiments, client system 130 may be an electronic deviceincluding hardware, software, or embedded logic components or acombination of two or more such components and capable of carrying outthe appropriate functionalities implemented or supported by clientsystem 130. As an example and not by way of limitation, a client system130 may include a computer system such as a desktop computer, notebookor laptop computer, netbook, a tablet computer, e-book reader, GPSdevice, camera, personal digital assistant (PDA), handheld electronicdevice, cellular telephone, smartphone, other suitable electronicdevice, or any suitable combination thereof. This disclosurecontemplates any suitable client systems 130. A client system 130 mayenable a network user at client system 130 to access network 110. Aclient system 130 may enable its user to communicate with other users atother client systems 130.

In particular embodiments, client system 130 may include a web browser132, such as MICROSOFT INTERNET EXPLORER, GOOGLE CHROME or MOZILLAFIREFOX, and may have one or more add-ons, plug-ins, or otherextensions, such as TOOLBAR or YAHOO TOOLBAR. A user at client system130 may enter a Uniform Resource Locator (URL) or other addressdirecting the web browser 132 to a particular server (such as server162, or a server associated with a third-party system 170), and the webbrowser 132 may generate a Hyper Text Transfer Protocol (HTTP) requestand communicate the HTTP request to server. The server may accept theHTTP request and communicate to client system 130 one or more Hyper TextMarkup Language (HTML) files responsive to the HTTP request. Clientsystem 130 may render a webpage based on the HTML files from the serverfor presentation to the user. This disclosure contemplates any suitablewebpage files. As an example and not by way of limitation, webpages mayrender from HTML files, Extensible Hyper Text Markup Language (XHTML)files, or Extensible Markup Language (XML) files, according toparticular needs. Such pages may also execute scripts such as, forexample and without limitation, those written in JAVASCRIPT, JAVA,MICROSOFT SILVERLIGHT, combinations of markup language and scripts suchas AJAX (Asynchronous JAVASCRIPT and XML), and the like. Herein,reference to a webpage encompasses one or more corresponding webpagefiles (which a browser may use to render the webpage) and vice versa,where appropriate.

In particular embodiments, social-networking system 160 may be anetwork-addressable computing system that can host an online socialnetwork. Social-networking system 160 may generate, store, receive, andtransmit social-networking data, such as, for example, user-profiledata, concept-profile data, social-graph information, or other suitabledata related to the online social network. Social-networking system 160may be accessed by the other components of network environment 100either directly or via network 110. In particular embodiments,social-networking system 160 may include one or more servers 162. Eachserver 162 may be a unitary server or a distributed server spanningmultiple computers or multiple datacenters. Servers 162 may be ofvarious types, such as, for example and without limitation, web server,news server, mail server, message server, advertising server, fileserver, application server, exchange server, database server, proxyserver, another server suitable for performing functions or processesdescribed herein, or any combination thereof. In particular embodiments,each server 162 may include hardware, software, or embedded logiccomponents or a combination of two or more such components for carryingout the appropriate functionalities implemented or supported by server162. In particular embodiments, social-networking system 164 may includeone or more data stores 164. Data stores 164 may be used to storevarious types of information. In particular embodiments, the informationstored in data stores 164 may be organized according to specific datastructures. In particular embodiments, each data store 164 may be arelational database. Particular embodiments may provide interfaces thatenable a client system 130, a social-networking system 160, or athird-party system 170 to manage, retrieve, modify, add, or delete, theinformation stored in data store 164.

In particular embodiments, social-networking system 160 may store one ormore social graphs in one or more data stores 164. In particularembodiments, a social graph may include multiple nodes—which may includemultiple user nodes (each corresponding to a particular user) ormultiple concept nodes (each corresponding to a particular concept)—andmultiple edges connecting the nodes. Social-networking system 160 mayprovide users of the online social network the ability to communicateand interact with other users. In particular embodiments, users may jointhe online social network via social-networking system 160 and then addconnections (i.e., relationships) to a number of other users ofsocial-networking system 160 whom they want to be connected to. Herein,the term “friend” may refer to any other user of social-networkingsystem 160 with whom a user has formed a connection, association, orrelationship via social-networking system 160.

In particular embodiments, social-networking system 160 may provideusers with the ability to take actions on various types of items orobjects, supported by social-networking system 160. As an example andnot by way of limitation, the items and objects may include groups orsocial networks to which users of social-networking system 160 maybelong, events or calendar entries in which a user might be interested,computer-based applications that a user may use, transactions that allowusers to buy or sell items via the service, interactions withadvertisements that a user may perform, or other suitable items orobjects. A user may interact with anything that is capable of beingrepresented in social-networking system 160 or by an external system ofthird-party system 170, which is separate from social-networking system160 and coupled to social-networking system 160 via a network 110.

In particular embodiments, social-networking system 160 may be capableof linking a variety of entities. As an example and not by way oflimitation, social-networking system 160 may enable users to interactwith each other as well as receive content from third-party systems 170or other entities, or to allow users to interact with these entitiesthrough an application programming interfaces (API) or othercommunication channels.

In particular embodiments, a third-party system 170 may include one ormore types of servers, one or more data stores, one or more interfaces,including but not limited to APIs, one or more web services, one or morecontent sources, one or more networks, or any other suitable components,e.g. that servers may communicate with. A third-party system 170 may beoperated by a different entity from an entity operatingsocial-networking system 160. In particular embodiments, however,social-networking system 160 and third-party systems 170 may operate inconjunction with each other to provide social-networking services tousers of social-networking system 160 or third-party systems 170. Inthis sense, social-networking system 160 may provide a platform, orbackbone, which other systems, such as third-party systems 170, may useto provide social-networking services and functionality to users acrossthe Internet.

In particular embodiments, a third-party system 170 may include athird-party content object provider. A third-party content objectprovider may include one or more sources of content objects, which maybe communicated to a client device 130. As an example and not by way oflimitation, content objects may include information regarding things oractivities of interest to the user, such as, for example, movie showtimes, movie reviews, restaurant reviews, restaurant menus, productinformation and reviews, or other suitable information. As anotherexample and not by way of limitation, content objects may includeincentive content objects, such as coupons, discount tickets, giftcertificates, or other suitable incentive objects.

In particular embodiments, social-networking system 160 also includesuser-generated content objects, which may enhance a user's interactionswith social-networking system 160. User-generated content may includeanything a user can add, upload, send, or “post” to social-networkingsystem 160. As an example and not by way of limitation, a usercommunicates posts to social-networking system 160 from a client device130. Posts may include data such as status updates or other textualdata, location information, photos, videos, links, music or othersimilar data or media. Content may also be added to social-networkingsystem 160 by a third-party through a “communication channel,” such as anewsfeed or stream.

In particular embodiments, social-networking system 160 may include avariety of servers, sub-systems, programs, modules, logs, and datastores. In particular embodiments, social-networking system 160 mayinclude one or more of the following: a web server, action logger,API-request server, relevance-and-ranking engine, content-objectclassifier, notification controller, action log,third-party-content-object-exposure log, inference module,authorization/privacy server, search module, ad-targeting module,user-interface module, user-profile store, connection store, third-partycontent store, or location store. Social-networking system 160 may alsoinclude suitable components such as network interfaces, securitymechanisms, load balancers, failover servers, management-and-networkoperations consoles, other suitable components, or any suitablecombination thereof. In particular embodiments, social-networking system160 may include one or more user-profile stores for storing userprofiles. A user profile may include, for example, biographicinformation, demographic information, behavioral information, socialinformation, or other types of descriptive information, such as workexperience, educational history, hobbies or preferences, interests,affinities, or location. Interest information may include interestsrelated to one or more categories. Categories may be general orspecific. As an example and not by way of limitation, if a user “likes”an article about a brand of shoes the category may be the brand, or thegeneral category of “shoes” or “clothing.” A connection store may beused for storing connection information about users. The connectioninformation may indicate users who have similar or common workexperience, group memberships, hobbies, educational history, or are inany way related or share common attributes. The connection informationmay also include user-defined connections between different users andcontent (both internal and external). A web server may be used forlinking social-networking system 160 to one or more client devices 130or one or more third-party system 170 via network 110. The web servermay include a mail server or other messaging functionality for receivingand routing messages between social-networking system 160 and one ormore client devices 130. An API-request server may allow a third-partysystem 170 to access information from social-networking system 160 bycalling one or more APIs. An action logger may be used to receivecommunications from a web server about a user's actions on or offsocial-networking system 160. In conjunction with the action log, athird-party-content-object log may be maintained of user exposures tothird-party-content objects. A notification controller may provideinformation regarding content objects to a client device 130.Information may be pushed to a client device 130 as notifications, orinformation may be pulled from client device 130 responsive to a requestreceived from client device 130. Authorization servers may be used toenforce one or more privacy settings of the users of social-networkingsystem 160. A privacy setting of a user determines how particularinformation associated with a user can be shared. The authorizationserver may allow users to opt in or opt out of having their actionslogged by social-networking system 160 or shared with other systems(e.g. third-party system 170), such as, for example, by settingappropriate privacy settings. Third-party-content-object stores may beused to store content objects received from third parties, such as athird-party system 170. Location stores may be used for storing locationinformation received from client devices 130 associated with users.Ad-pricing modules may combine social information, the current time,location information, or other suitable information to provide relevantadvertisements, in the form of notifications, to a user.

FIG. 2 illustrates example social graph 200. In particular embodiments,social-networking system 160 may store one or more social graphs 200 inone or more data stores. In particular embodiments, social graph 200 mayinclude multiple nodes—which may include multiple user nodes 202 ormultiple concept nodes 204—and multiple edges 206 connecting the nodes.Example social graph 200 illustrated in FIG. 2 is shown, for didacticpurposes, in a two-dimensional visual map representation. In particularembodiments, a social-networking system 160, client system 130, orthird-party system 170 may access social graph 200 and relatedsocial-graph information for suitable applications. The nodes and edgesof social graph 200 may be stored as data objects, for example, in adata store (such as a social-graph database). Such a data store mayinclude one or more searchable or queryable indexes of nodes or edges ofsocial graph 200.

In particular embodiments, a user node 202 may correspond to a user ofsocial-networking system 160. As an example and not by way oflimitation, a user may be an individual (human user), an entity (e.g. anenterprise, business, or third-party application), or a group (e.g. ofindividuals or entities) that interacts or communicates with or oversocial-networking system 160. In particular embodiments, when a userregisters for an account with social-networking system 160,social-networking system 160 may create a user node 202 corresponding tothe user, and store the user node 202 in one or more data stores. Usersand user nodes 202 described herein may, where appropriate, refer toregistered users and user nodes 202 associated with registered users. Inaddition or as an alternative, users and user nodes 202 described hereinmay, where appropriate, refer to users that have not registered withsocial-networking system 160. In particular embodiments, a user node 202may be associated with information provided by a user or informationgathered by various systems, including social-networking system 160. Asan example and not by way of limitation, a user may provide his or hername, profile picture, contact information, birth date, sex, maritalstatus, family status, employment, education background, preferences,interests, or other demographic information. In particular embodiments,a user node 202 may be associated with one or more data objectscorresponding to information associated with a user. In particularembodiments, a user node 202 may correspond to one or more webpages orone or more user-profile pages (which may be webpages).

In particular embodiments, a concept node 204 may correspond to aconcept. As an example and not by way of limitation, a concept maycorrespond to a place (such as, for example, a movie theater,restaurant, landmark, or city); a website (such as, for example, awebsite associated with social-network system 160 or a third-partywebsite associated with a web-application server); an entity (such as,for example, a person, business, group, sports team, or celebrity); aresource (such as, for example, an audio file, video file, digitalphoto, text file, structured document, or application) which may belocated within social-networking system 160 or on an external server,such as a web-application server; real or intellectual property (suchas, for example, a sculpture, painting, movie, game, song, idea,photograph, or written work); a game; an activity; an idea or theory;another suitable concept; or two or more such concepts. A concept node204 may be associated with information of a concept provided by a useror information gathered by various systems, including social-networkingsystem 160. As an example and not by way of limitation, information of aconcept may include a name or a title; one or more images (e.g. an imageof the cover page of a book); a location (e.g. an address or ageographical location); a website (which may be associated with a URL);contact information (e.g. a phone number or an email address); othersuitable concept information; or any suitable combination of suchinformation. In particular embodiments, a concept node 204 may beassociated with one or more data objects corresponding to informationassociated with concept node 204. In particular embodiments, a conceptnode 204 may correspond to a webpage.

In particular embodiments, a node in social graph 200 may represent orbe represented by a webpage (which may be referred to as a “profilepage”). Profile pages may be hosted by or accessible tosocial-networking system 160. Profile pages may also be hosted onthird-party websites associated with a third-party server 170. As anexample and not by way of limitation, a profile page corresponding to aparticular external webpage may be the particular external webpage andthe profile page may correspond to a particular concept node 204.Profile pages may be viewable by all or a selected subset of otherusers. As an example and not by way of limitation, a user node 202 mayhave a corresponding user-profile page in which the corresponding usermay add content, make declarations, or otherwise express himself orherself. As another example and not by way of limitation, a concept node204 may have a corresponding concept-profile page in which one or moreusers may add content, make declarations, or express themselves,particularly in relation to the concept corresponding to concept node204.

In particular embodiments, a concept node 204 may represent athird-party webpage or resource hosted by a third-party system 170. Thethird-party webpage or resource may include, among other elements,content, a selectable or other icon, or other inter-actable object(which may be implemented, for example, in JavaScript, AJAX, or PHPcodes) representing an action or activity. As an example and not by wayof limitation, a third-party webpage may include a selectable icon suchas “like,” “check in,” “eat,” “recommend,” or another suitable action oractivity. A user viewing the third-party webpage may perform an actionby selecting one of the icons (e.g. “eat”), causing a client system 130to transmit to social-networking system 160 a message indicating theuser's action. In response to the message, social-networking system 160may create an edge (e.g. an “eat” edge) between a user node 202corresponding to the user and a concept node 204 corresponding to thethird-party webpage or resource and store edge 206 in one or more datastores.

In particular embodiments, a pair of nodes in social graph 200 may beconnected to each other by one or more edges 206. An edge 206 connectinga pair of nodes may represent a relationship between the pair of nodes.In particular embodiments, an edge 206 may include or represent one ormore data objects or attributes corresponding to the relationshipbetween a pair of nodes. As an example and not by way of limitation, afirst user may indicate that a second user is a “friend” of the firstuser. In response to this indication, social-networking system 160 maytransmit a “friend request” to the second user. If the second userconfirms the “friend request,” social-networking system 160 may createan edge 206 connecting the first user's user node 202 to the seconduser's user node 202 in social graph 200 and store edge 206 associal-graph information in one or more of data stores 24. In theexample of FIG. 2, social graph 200 includes an edge 206 indicating afriend relation between user nodes 202 of user “A” and user “B” and anedge indicating a friend relation between user nodes 202 of user “C” anduser “B.” Although this disclosure describes or illustrates particularedges 206 with particular attributes connecting particular user nodes202, this disclosure contemplates any suitable edges 206 with anysuitable attributes connecting user nodes 202. As an example and not byway of limitation, an edge 206 may represent a friendship, familyrelationship, business or employment relationship, fan relationship,follower relationship, visitor relationship, sub scriber relationship,superior/subordinate relationship, reciprocal relationship,non-reciprocal relationship, another suitable type of relationship, ortwo or more such relationships. Moreover, although this disclosuregenerally describes nodes as being connected, this disclosure alsodescribes users or concepts as being connected. Herein, references tousers or concepts being connected may, where appropriate, refer to thenodes corresponding to those users or concepts being connected in socialgraph 200 by one or more edges 206.

In particular embodiments, an edge 206 between a user node 202 and aconcept node 204 may represent a particular action or activity performedby a user associated with user node 202 toward a concept associated witha concept node 204. As an example and not by way of limitation, asillustrated in FIG. 2, a user may “like,” “attended,” “played,”“listened,” “cooked,” “worked at,” or “watched” a concept, each of whichmay correspond to a edge type or subtype. A concept-profile pagecorresponding to a concept node 204 may include, for example, aselectable “check in” icon (such as, for example, a clickable “check in”icon) or a selectable “add to favorites” icon. Similarly, after a userclicks these icons, social-networking system 160 may create a “favorite”edge or a “check in” edge in response to a user's action correspondingto a respective action. As another example and not by way of limitation,a user (user “C”) may listen to a particular song (“Imagine”) using aparticular application (SPOTIFY, which is an online music application).In this case, social-networking system 160 may create a “listened” edge206 and a “used” edge (as illustrated in FIG. 2) between user nodes 202corresponding to the user and concept nodes 204 corresponding to thesong and application to indicate that the user listened to the song andused the application. Moreover, social-networking system 160 may createa “played” edge 206 (as illustrated in FIG. 2) between concept nodes 204corresponding to the song and the application to indicate that theparticular song was played by the particular application. In this case,“played” edge 206 corresponds to an action performed by an externalapplication (SPOTIFY) on an external audio file (the song “Imagine”).Although this disclosure describes particular edges 206 with particularattributes connecting user nodes 202 and concept nodes 204, thisdisclosure contemplates any suitable edges 206 with any suitableattributes connecting user nodes 202 and concept nodes 204. Moreover,although this disclosure describes edges between a user node 202 and aconcept node 204 representing a single relationship, this disclosurecontemplates edges between a user node 202 and a concept node 204representing one or more relationships. As an example and not by way oflimitation, an edge 206 may represent both that a user likes and hasused at a particular concept. Alternatively, another edge 206 mayrepresent each type of relationship (or multiples of a singlerelationship) between a user node 202 and a concept node 204 (asillustrated in FIG. 2 between user node 202 for user “E” and conceptnode 204 for “SPOTIFY”).

In particular embodiments, social-networking system 160 may create anedge 206 between a user node 202 and a concept node 204 in social graph200. As an example and not by way of limitation, a user viewing aconcept-profile page (such as, for example, by using a web browser or aspecial-purpose application hosted by the user's client system 130) mayindicate that he or she likes the concept represented by the conceptnode 204 by clicking or selecting a “Like” icon, which may cause theuser's client system 130 to transmit to social-networking system 160 amessage indicating the user's liking of the concept associated with theconcept-profile page. In response to the message, social-networkingsystem 160 may create an edge 206 between user node 202 associated withthe user and concept node 204, as illustrated by “like” edge 206 betweenthe user and concept node 204. In particular embodiments,social-networking system 160 may store an edge 206 in one or more datastores. In particular embodiments, an edge 206 may be automaticallyformed by social-networking system 160 in response to a particular useraction. As an example and not by way of limitation, if a first useruploads a picture, watches a movie, or listens to a song, an edge 206may be formed between user node 202 corresponding to the first user andconcept nodes 204 corresponding to those concepts. Although thisdisclosure describes forming particular edges 206 in particular manners,this disclosure contemplates forming any suitable edges 206 in anysuitable manner.

FIG. 3 illustrates an example client system 130, a mobile device, whichmay communicate with a social-networking system 160 via a network 110.This disclosure contemplates mobile device 300 taking any suitablephysical form. As example and not by way of limitation, mobile device300 may be a single-board computer system (SBC) (such as, for example, acomputer-on-module (COM) or system-on-module (SOM)), a laptop ornotebook computer system, a mobile telephone, a smartphone, a personaldigital assistant (PDA), a tablet computer system, or a combination oftwo or more of these. In particular embodiments, mobile device 300 mayhave a touch screen 312 as an input component. In the example of FIG. 3,touch screen 312 is incorporated on a front surface of mobile device300. In the case of capacitive touch sensors, there may be two types ofelectrodes: transmitting and receiving. These electrodes may beconnected to a controller designed to drive the transmitting electrodeswith electrical pulses and measure the changes in capacitance from thereceiving electrodes caused by a touch or proximity input. In theexample of FIG. 3, one or more antennae 314A-C may be incorporated intoone or more sides of mobile device 300. Antennae 314A-C are componentsthat convert electric current into radio waves, and vice versa. Duringtransmission of signals, a transmitter applies an oscillating radiofrequency (RF) electric current to terminals of antennae 314A-C, andantennae 314A-C radiate the energy of the applied the current aselectromagnetic (EM) waves. During reception of signals, antennae 314A-Cconvert the power of an incoming EM wave into a voltage at the terminalsof antennae 314A-C. The voltage may be transmitted to a receiver foramplification.

While the mobile device 300 may be implemented in a variety of differenthardware and computing systems, FIG. 4 shows a schematic representationof the main components of an example computing platform of a mobiledevice, according to various particular embodiments. In particularembodiments, computing platform 402 may comprise controller 404, memory406, and input output subsystem 410. In particular embodiments,controller 404 which may comprise one or more processors and/or one ormore microcontrollers configured to execute instructions and to carryout operations associated with a computing platform. In variousembodiments, controller 404 may be implemented as a single-chip,multiple chips and/or other electrical components including one or moreintegrated circuits and printed circuit boards. Controller 404 mayoptionally contain a cache memory unit for temporary local storage ofinstructions, data, or computer addresses. By way of example, usinginstructions retrieved from memory, controller 404 may control thereception and manipulation of input and output data between componentsof computing platform 402. By way of example, controller 404 may includeone or more processors or one or more controllers dedicated for certainprocessing tasks of computing platform 402, for example, for 2D/3Dgraphics processing, image processing, or video processing.

Controller 404 together with a suitable operating system may operate toexecute instructions in the form of computer code and produce and usedata. By way of example and not by way of limitation, the operatingsystem may be Windows-based, Mac-based, or Unix or Linux-based, orSymbian-based, among other suitable operating systems. The operatingsystem, other computer code and/or data may be physically stored withinmemory 406 that is operatively coupled to controller 404.

Memory 406 may encompass one or more storage media and generally providea place to store computer code (e.g. software and/or firmware) and datathat are used by computing platform 402. By way of example, memory 406may include various tangible computer-readable storage media includingRead-Only Memory (ROM) and/or Random-Access Memory (RAM). As is wellknown in the art, ROM acts to transfer data and instructionsuni-directionally to controller 404, and RAM is used typically totransfer data and instructions in a bi-directional manner. Memory 406may also include one or more fixed storage devices in the form of, byway of example, hard disk drives (HDDs), solid-state drives (SSDs),flash-memory cards (e.g. Secured Digital or SD cards), among othersuitable forms of memory coupled bi-directionally to controller 404.Information may also reside on one or more removable storage medialoaded into or installed in computing platform 402 when needed. By wayof example, any of a number of suitable memory cards (e.g. SD cards) maybe loaded into computing platform 402 on a temporary or permanent basis.

Input output subsystem 410 may comprise one or more input and outputdevices operably connected to controller 404. For example, input outputsubsystem may include keyboard, mouse, one or more buttons, and/or,display (e.g. liquid crystal display (LCD), or any other suitabledisplay technology). Generally, input devices are configured to transferdata, commands and responses from the outside world into computingplatform 402. The display is generally configured to display a graphicaluser interface (GUI) that provides an easy to use visual interfacebetween a user of the computing platform 402 and the operating system orapplication(s) running on the mobile device. Generally, the GUI presentsprograms, files and operational options with graphical images. Duringoperation, the user may select and activate various graphical imagesdisplayed on the display in order to initiate functions and tasksassociated therewith. Input output subsystem 410 may also include touchbased devices such as touch pad and touch screen. A touchpad is an inputdevice including a surface that detects touch-based inputs of users.Similarly, a touch screen is a display that detects the presence andlocation of user touch inputs. Input output system 410 may also includedual touch or multi-touch displays or touch pads that can identify thepresence, location and movement of more than one touch inputs, such astwo or three finger touches.

In particular embodiments, computing platform 402 may additionallycomprise audio subsystem 412, camera subsystem 412, wirelesscommunication subsystem 416, sensor subsystems 418, and/or wiredcommunication subsystem 420, operably connected to controller 404 tofacilitate various functions of computing platform 402. For example,Audio subsystem 412, including a speaker, a microphone, and a codecmodule configured to process audio signals, can be utilized tofacilitate voice-enabled functions, such as voice recognition, voicereplication, digital recording, and telephony functions. For example,camera subsystem 412, including an optical sensor (e.g. a chargedcoupled device (CCD), image sensor), can be utilized to facilitatecamera functions, such as recording photographs and video clips. Forexample, wired communication subsystem 420 can include a UniversalSerial Bus (USB) port for file transferring, or a Ethernet port forconnection to a local area network (LAN). Additionally, computingplatform 402 may be powered by power source 432.

Wireless communication subsystem 416 can be designed to operate over oneor more wireless networks, for example, a wireless PAN (WPAN) (e.g. aBLUETOOTH), a WI-FI network (e.g. an 802.11a/b/g/n network), a WI-MAXnetwork, a cellular network (such as, for example, a Global System forMobile Communications (GSM) network, a Long Term Evolution (LTE)network). Additionally, wireless communication subsystem 416 may includehosting protocols such that computing platform 402 may be configured asa base station for other wireless devices. Other input/output devicesmay include an accelerometer that can be used to detect the orientationof the device.

Sensor subsystem 418 may include one or more sensor devices to provideadditional input and facilitate multiple functionalities of computingplatform 402. For example, sensor subsystems 418 may include GPS sensorfor location positioning, altimeter for altitude positioning, motionsensor for determining orientation of a mobile device, light sensor forphotographing function with camera subsystem 414, temperature sensor formeasuring ambient temperature, and/or biometric sensor for securityapplication (e.g. fingerprint reader).

In particular embodiments, various components of computing platform 402may be operably connected together by one or more buses (includinghardware and/or software). As an example and not by way of limitation,the one or more buses may include an Accelerated Graphics Port (AGP) orother graphics bus, a front-side bus (FSB), a HYPERTRANSPORT (HT)interconnect, an Industry Standard Architecture (ISA) bus, an INFINIBANDinterconnect, a low-pin-count (LPC) bus, a memory bus, a PeripheralComponent Interconnect Express PCI-Express bus, a serial advancedtechnology attachment (SATA) bus, a Inter-Integrated Circuit (I2C) bus,a Secure Digital (SD) memory interface, a Secure Digital Input Output(SDIO) interface, a Universal Serial Bus (USB) bus, a General PurposeInput/Output (GPIO) bus, an Advanced Microcontroller Bus Architecture(AMBA) bus, or another suitable bus or a combination of two or more ofthese.

In particular embodiments, mobile device 300 and social-networkingsystem 160 may communicate over network 110 via a packet-basedcommunication protocol including, for example and without limitation,Transmission Control Protocol over Internet Protocol (TCP/IP). Althoughparticular embodiments using TCP/IP will be discussed, it should beunderstood that any packet-, segment-, or frame-based communicationprotocol (e.g. at the transport, network, or data link layers) may beused to communicate data between mobile device 300 and social-networkingsystem 160. In particular embodiments, mobile device 300 and a server162 (e.g. a web server) of social-networking system 160 may communicatevia a packet-based communication protocol such as TCP/IP. In the exampleof TCP/IP, a TCP network socket (e.g. one end of an end-to-end networkconnection between a client and a server) may be kept open at server162, and data to be communicated to mobile device 300 may be pushed ontothe TCP socket in the form of packets. Similarly, a TCP socket may bekept open at mobile device 300, and data to be communicated to server162 may be pushed onto the TCP socket in the form of packets. Thepackets, segments, or frames used to communicate data using a givenprotocol, including, for example, TCP/IP may have a fixed size (e.g.payload size). For the sake of clarity, this disclosure will discussdata as being communicated in the form of packets with a fixed payloadsize of M bytes, but any suitable unit of data transmission with anysuitable size (whether fixed or variable) is contemplated by thisdisclosure.

As described earlier, a user of a mobile device 300 may upload contentto social-networking system 160. In particular embodiments, a user mayutilize mobile device 300 to upload content or perform actions onsocial-networking system 160, including, for example, status updates orother textual data, location information, photos, videos, links, musicor other similar data or media. In particular cases where a large numberof clients using mobile devices serviced by, for example, the samecarrier cellular tower are simultaneously attempting content uploads tosocial-networking system 160, the carrier's wireless cellular networkmay become overloaded. For example, in Universal MobileTelecommunications Systems (UMTS), a particular Node B base station mayonly support a limited amount of data bandwidth. Because eachapplication running on each mobile device 300 has its own bandwidthrequirements, in a crowded environment, such as a baseball game orpublic event, a single Node B may become overloaded fairly quickly. As aresult, users' socket connections to social-networking system 160 maytime out, thereby causing their uploads or downloads of data to fail,and undermine the overall responsiveness and user experience.

Packets may have a fixed payload size, for example M bytes. Thetransmission of data in packets occurs using an integer number ofpackets (and, therefore, an integer multiple of M bytes). It may happen,however, that the data to be transmitted is of a size only slightlylarger than M bytes. Transmitting this data would still require at leasttwo M-byte data packets, but the second packet may be almost empty ofdata. Despite this fact, to fully transmit the data, both packets mustbe transmitted, and this requires twice the bandwidth usage oftransmitting only one packet. Similarly, if the data to be transmittedis of a size only slightly larger than an integer multiple of M bytes,the final packet may still be almost empty of data. This situation maybe exacerbated in the case of multiple applications running on a mobiledevice 300, as each application running on the mobile device 300 mayhave only a small amount of data to be transmitted (e.g. continuousstatus updates), but may transmit this data inefficiently by requiringthe transmission of packets that are not full. Similarly, if a server(e.g. server 162) has a small amount of data to be transmitted (e.g.push notifications for a user), this data may also be transmittedinefficiently if it requires the transmission of packets that are notfull.

In particular embodiments, the mobile device 300 may queue one or moreof the content or activity posts for upload at a later time in order to,for example, conserve bandwidth. An example of throttling networktraffic at a client-side device (e.g. mobile device 300) by queuingcontent for transmission to a social-networking system is disclosed inU.S. patent application Ser. No. 13/210,953, entitled “Server-InitiatedBandwidth Conservation Policies,” filed 16 Aug. 2011, and incorporatedherein by reference as an example only and not by way of limitation.

In particular embodiments, the transmission of data in packets may beadjusted, for example, to conserve bandwidth. The packet-transmissionalgorithm may include a prioritization or ranking of what content (e.g.which data items such as posts in social-networking system 160) areplaced into a particular packet or group of packets. As an example,depending on bandwidth constraints, only the most important or relevantdata (e.g. across multiple applications on mobile device 300) may betransmitted in packets. As another example, depending on bandwidthconstraints, the most important or relevant data (e.g. across multipleapplications on mobile device 300) may be transmitted first over lessimportant data. Measures of importance or relevance are discussedfurther below. The packet-transmission algorithm may attempt to transmitpackets that are as full of data as possible.

In particular embodiments, as part of the packet-transmission algorithm,the constraints on available bandwidth may be determined. In particularembodiments, social-networking system 160 may log certain geographicregions and times where overloading of network 110 (e.g. a wireless datanetwork) is likely to occur. For example, based on a log of historicaloverloading of network 110 in particular geographic regions (e.g.determined by data uploaded by client systems 130 including mobiledevice 300), social-networking system 160 may form an estimate of thedata transmission capacity of network 110 in the geographic regions. Inparticular embodiments, social-networking system 160 may augment itsdatabase of network capacity information with external information, suchas event databases or sporting event schedules. Social-networking system160 may also determine constraints on available bandwidth by querying anetwork operator to determine how much capacity is available, forexample, on a cell by cell basis. As an example, a wireless networkoperator may be queried by social-networking system 160 to determine howmuch bandwidth is available at a particular cell in the networkoperator's wireless network nearest to where a particular mobile device300 is currently located. In yet other embodiments, the wireless networkoperator may be queried by mobile device 300 itself to determine howmuch bandwidth is available to mobile device 300 at the cell currentlyhandling the data traffic to and from mobile device 300. In particularembodiments, characteristics of the operation of mobile device 300 maybe used to determine constraints on bandwidth. These characteristicsmay, for example, be determined at mobile device 300, communicated tosocial-networking system 160, and used by mobile device 300 orsocial-networking system 160 to determine bandwidth constraints. As anexample, the power state of mobile device 300 (e.g. battery level or anindication that the device is being charged) may be used to determinewhether more or less bandwidth may be used by mobile device 300. If, forexample, the device battery level is low, less bandwidth may be used bymobile device 300 (e.g. in order to conserve battery), and fewerpackets, containing, for example, more important or relevantinformation, may be sent to or from mobile device 300. As anotherexample, a user activity level of the user of mobile device 300 (e.g.whether the user is touching the device, or whether the device isstationary for long periods of time) may be used to determine whethermore or less bandwidth may be used by mobile device 300. If, forexample, a user is actively touching mobile device 300 (determined, e.g.by one or more touch sensor of sensor subsystems 418), more bandwidthmay be used by mobile device 300 to enhance the user's experience, andmore packets (e.g. with less important or relevant information) may besent to or from mobile device 300. If, as another example, mobile device300 has been stationary (e.g. sitting on a table) for more than athreshold amount of time (e.g. 20 minutes), less bandwidth may be usedby mobile device 300 (e.g. in order to conserve battery), and fewerpackets, containing, for example, more important or relevantinformation, may be sent to or from mobile device 300. As yet anotherexample, the radio network characteristics of mobile device 300 (e.g.cellular signal strength, type of cellular network coverage,availability of WI FI, etc.) may be used to determine whether more orless bandwidth may be used by mobile device 300. If, for example, signalstrength is weak, the mobile device 300 is in a roaming mode, or themobile device 300 is outside a UMTS coverage area, less bandwidth may beused by mobile device 300 (e.g. in order to conserve battery or avoidunnecessary data charges), and fewer packets, containing, for example,more important or relevant information, may be sent to or from mobiledevice 300. If, as another example, the signal is strong or the deviceis in an area with WI FI availability, more bandwidth may be used bymobile device 300 to enhance the user's experience, and more packets(e.g. with less important or relevant information) may be sent to orfrom mobile device 300. The cost of bandwidth usage may also be used todetermine whether more or less bandwidth may be used by mobile device300. For example, in a home WI FI setting, the cost of bandwidth usageby mobile device 300 may be negligible, and mobile device 300 may usemore bandwidth. As another example, in a 4G (fourth generation) cellularnetwork, the cost of bandwidth usage by mobile device 300 may depend ona relatively small monthly bandwidth cap for an account associated withmobile device 300 (because bandwidth usage beyond this cap may becharged at much higher rates than bandwidth usage below this cap), andmobile device 300 may use more or less bandwidth depending on currentusage in relation to the cap. Similarly, if mobile device 300 is in aninternational roaming mode, the cost of bandwidth usage by mobile device300 may be very large, and mobile device 300 may use less bandwidth.Bandwidth availability or constraints may be determined on a per-user,per-device basis in any of the techniques described above.

As described above, based on a determination of bandwidth constraints oravailable bandwidth, social-networking system 160 (e.g. server 162),mobile device 300, or both may use a packet-transmission algorithm todetermine a prioritization or ranking of what content (e.g. which dataitems such as posts in social-networking system 160) are placed into aparticular packet or group of packets. The prioritization or ranking ofcontent may occur based on a variety of factors and may involve contentfrom a variety of applications on mobile device 300. In particularembodiments, a process (running on server 162, at mobile device 300, orboth) may determine a value for each of the one or more outgoing dataitems. In particular embodiments, the process may determine a value foreach of the one or more outgoing data items based on the content or typeof each of the one or more outgoing data items. For example, the processmay assign a higher value to a data item having content indicatingurgency (e.g. a message with the words “urgent,” “important,” or“emergency”). As another example, the process may assign a higher valueto a message sent directly to a user of mobile device 300 than it wouldto a notification that another user of social-networking system 160 haslistened to a particular song. In particular embodiments, the processmay determine a value for each of the one or more outgoing data itemsbased on an affinity or social relevancy between each of the one or moreoutgoing data items and a user of mobile device 300—e.g. based on anaffinity between each outgoing data item's originator and the user.Outgoing data items such as notifications of posts in specific groupsrelevant to a user of mobile device 300, replies to the user's ownposts, or replies to the user's own comments on a post onsocial-networking system 160 may all be scored using affinity. Forexample, the process may assign each of the one or more outgoing dataitems an affinity value. For example, the process may assign an affinityvalue of 1.0 to an outgoing data item if the outgoing data item'soriginator is the immediate family member (e.g. parent, sibling) of auser of the mobile device 300, or an affinity value of 0.9 if theoutgoing data item's originator frequently communicates with a user ofmobile device 300, or an affinity value of 0.7 if the outgoing dataitem's originator is a first-degree social contact of a user of mobiledevice 300 in a social graph of social-networking system 160.Interaction between users (e.g. users of client devices 130) onsocial-networking system 160, such as chats, posts, emails, and thelike, may also be used in scoring affinities between users ofsocial-networking system. A system for measuring user affinity isdescribed more generally in U.S. patent application Ser. No. 11/503,093,entitled “Providing a Newsfeed Based on User Affinity in a SocialNetwork Environment,” filed on Aug. 11, 2006, which is herebyincorporated by reference in its entirety as an example only and not byway of limitation. The prioritization or ranking of content may alsooccur based on categories. As an example, data items may be divided intocategories such as “mandatory for transmission” and “optional fortransmission.” The division of data items into multiple categories maydepend, for example, on the value of each data item, such that eachcategory corresponds to a range of values for data items (e.g. a valueof 0.5-1.0 corresponds to the mandatory transmission category, and avalue of 0-0.49 corresponds to the optional transmission category).

Based on the determination of bandwidth constraints or availablebandwidth and the prioritization or ranking of outgoing data items,social-networking system 160 (e.g. server 162), mobile device 300, orboth may determine which data items are placed into a particular packetor group of packets for transmission. In particular embodiments, basedon bandwidth constraints or available bandwidth, an available number ofpackets for transmission in a given time period is determined. Forexample, if the available bandwidth is determined to be 5 kilobytes persecond, and each packet has a payload size M=40 bytes, then there are atotal of 128 packets available for transmitting data items to mobiledevice 300 or server 126 in a one-second timeframe. In particularembodiments, once the total number of available packets for a timeframeis determined, the packet-transmission algorithm executed, for example,by a process (running on server 162, at mobile device 300, or both) maydetermine which data items are placed in these packets for transmission.The process may determine this based on a prioritization or ranking ofoutgoing data items based on values or categories of data items. Forexample, the process may determine that all mandatory data items are tobe placed in packets and transmitted sequentially before any optionaldata items are placed in packets and transmitted. As an example, if thepacket payload size is M=40 bytes, there are 5 available packets in agiven timeframe, and there are 100 bytes of mandatory data items and 200bytes of optional data items to be transmitted in the timeframe, theprocess may fill the first two packets with 80 total bytes of mandatorydata items and send them. The process may then fill the third packetwith the remaining 20 bytes of mandatory data items, and then seek tofill the remaining 20 bytes of the third packet with optional data itemsbefore sending it. The fourth and fifth packets may be filled with 80total bytes of the optional data items. If the bandwidth is not enoughto support the amount of mandatory data items (e.g. the packet payloadsize is M=40 bytes, there are 5 available packets in a given timeframe,and there are 300 bytes of mandatory data items), the process may chooseto fill the available packets with mandatory data items (e.g. based on aranking of the mandatory data items) and wait until the next timeframeto send the remaining bytes of mandatory data items. As another example,if the packet payload size is M=40 bytes, there are 5 available packetsin a given timeframe, and there are 300 bytes of outgoing data itemsranked by value, the process may seek to sequentially fill and send thefive packets with the 200 bytes of data items ranked from most importantor relevant (e.g. having the highest value) to least important orrelevant. In the next timeframe, the remaining 100 bytes of outgoingdata items may be sent, or, alternatively, in the next timeframe, theoutgoing data items (including the remaining 100 bytes from the lasttimeframe) may again be ranked and then sent accordingly. In particularembodiments, the process may determine a threshold value that each ofthe one or more outgoing data items must meet or exceed in order to beplaced into a packet for transmission. This threshold value may bedependent on bandwidth constraints. As an example, in a home WI FIsetting, the threshold value may be relatively low; in a 4G cellularnetwork when the current usage is near a usage cap, the threshold valuemay be relatively high; and if mobile device 300 is in an internationalroaming mode, the threshold value may be relatively very high.

In particular embodiments, the determination of which data items areplaced into a particular packet or group of packets for transmissionincludes compressing the data items before transmission. The compressionmay be done by any suitable compression technique including, for exampleand without limitation, packet-by-packet dictionary compression orguess-table-based compression. As described above, the outgoing dataitems may be prioritized or ranked based, for example, on values orcategories. As an example, if the outgoing data items are ranked basedon the categories “mandatory” and “optional,” the mandatory data itemsmay be run through the compressor (or, in other embodiments, acompression simulator) to determine the number of bytes of compressedmandatory data items to be transmitted. The total number of bytes ofpost-compression mandatory data items may then be compared to theavailable bandwidth (e.g. the number of available packets in a giventimeframe). For example, if there are N=75 total bytes of compressedmandatory data items and there are 5 available packets with payload sizeM=40 bytes each, then the first packet may be filled and sent with 40bytes of compressed mandatory data items, and the second packet may befilled with 35 bytes of compressed mandatory data items. Generally, thenumber of packets with payload size M bytes to be completely filled withcompressed mandatory data items of total size N bytes is determined bycalculating N divided by M (and ignoring any remainder), and the numberof bytes of remaining compressed mandatory data items is calculated viaN modulo M. At this point, the remaining 5 bytes of the second packet(and the remaining 3 empty packets) may be filled with optional dataitems. The determination of which optional data items are prioritized tobe placed into the second (and any subsequent) packet may be done in avariety of ways. In one embodiment, the optional data items may beranked based on a value calculated for each of the optional data items,as described above. In another embodiment, the optional data items maybe ranked based on a further categorization of data items (e.g.categories based on values), as described above. In yet anotherembodiment, the optional data items may be prioritized based on how oneor more of the optional data items compress, and whether this leads to adesirable packing of bytes of the available packets (e.g. whether thepackets would be as close to full as possible without overflowing). Inthe example above, an optional data item (or combination of optionaldata items) whose compressed data size is as close to 5 bytes aspossible (e.g. in comparison with the other optional data items) may bechosen to fill the second packet. For the third, fourth, and fifthpackets, any method of selecting or prioritizing optional data items (orany combination thereof) may be employed, including, for example,choosing for each packet the optional data items or set of optional dataitems within a certain category that compress to a size as close to Mbytes as possible. The selection of data items for transmission based oncompressed data size may be done dynamically, as the amount ofcompression may depend on the data items on hand for transmission; forexample, multiple data items of similar formats may compress more thanmultiple data items of differing formats.

FIG. 5 illustrates an example method for transmitting data packets froma first computing device to a second computing device. At step 510, afirst computing device determines a number of data packets available totransmit (e.g. based on bandwidth constraints or available bandwidth, aswell as a data packet payload capacity) from the first computing deviceto a second computing device. The first computing device may be mobiledevice 300, and the second computing device may be server 162. The firstcomputing device may be server 162, and the second computing device maybe mobile device 300. Each of the data packets may have a payload withthe data packet payload capacity (e.g. M bytes per packet) used todetermine the number of data packets available for transmission. Inparticular embodiments, the payload capacity may vary from packet topacket and may vary over time. At step 520, the first computing devicedetermines a plurality of data items (e.g. outgoing data items) totransmit from the first computing device to the second computing device.At step 530, the first computing device ranks the data items (e.g. byany of the prioritization or ranking techniques described above). Atstep 540, the first computing device selects, based at least in part onthe ranking of the data items and the payload capacities of the datapackets, one or more data items to transmit from the first computingdevice to the second computing device in the data packets. At step 550,the first computing device writes data items to the payloads of the datapackets.

FIG. 6 illustrates an example computer system 600. In particularembodiments, one or more computer systems 600 perform one or more stepsof one or more methods described or illustrated herein. In particularembodiments, one or more computer systems 600 provide functionalitydescribed or illustrated herein. In particular embodiments, softwarerunning on one or more computer systems 600 performs one or more stepsof one or more methods described or illustrated herein or providesfunctionality described or illustrated herein. Particular embodimentsinclude one or more portions of one or more computer systems 600.Herein, reference to a computer system may encompass a computing device,where appropriate. Moreover, reference to a computer system mayencompass one or more computer systems, where appropriate.

This disclosure contemplates any suitable number of computer systems600. This disclosure contemplates computer system 600 taking anysuitable physical form. As example and not by way of limitation,computer system 600 may be an embedded computer system, a system-on-chip(SOC), a single-board computer system (SBC) (such as, for example, acomputer-on-module (COM) or system-on-module (SOM)), a desktop computersystem, a laptop or notebook computer system, an interactive kiosk, amainframe, a mesh of computer systems, a mobile telephone, a personaldigital assistant (PDA), a server, a tablet computer system, or acombination of two or more of these. Where appropriate, computer system600 may include one or more computer systems 600; be unitary ordistributed; span multiple locations; span multiple machines; spanmultiple data centers; or reside in a cloud, which may include one ormore cloud components in one or more networks. Where appropriate, one ormore computer systems 600 may perform without substantial spatial ortemporal limitation one or more steps of one or more methods describedor illustrated herein. As an example and not by way of limitation, oneor more computer systems 600 may perform in real time or in batch modeone or more steps of one or more methods described or illustratedherein. One or more computer systems 600 may perform at different timesor at different locations one or more steps of one or more methodsdescribed or illustrated herein, where appropriate.

In particular embodiments, computer system 600 includes a processor 602,memory 604, storage 606, an input/output (I/O) interface 608, acommunication interface 610, and a bus 612. Although this disclosuredescribes and illustrates a particular computer system having aparticular number of particular components in a particular arrangement,this disclosure contemplates any suitable computer system having anysuitable number of any suitable components in any suitable arrangement.

In particular embodiments, processor 602 includes hardware for executinginstructions, such as those making up a computer program. As an exampleand not by way of limitation, to execute instructions, processor 602 mayretrieve (or fetch) the instructions from an internal register, aninternal cache, memory 604, or storage 606; decode and execute them; andthen write one or more results to an internal register, an internalcache, memory 604, or storage 606. In particular embodiments, processor602 may include one or more internal caches for data, instructions, oraddresses. This disclosure contemplates processor 602 including anysuitable number of any suitable internal caches, where appropriate. Asan example and not by way of limitation, processor 602 may include oneor more instruction caches, one or more data caches, and one or moretranslation lookaside buffers (TLBs). Instructions in the instructioncaches may be copies of instructions in memory 604 or storage 606, andthe instruction caches may speed up retrieval of those instructions byprocessor 602. Data in the data caches may be copies of data in memory604 or storage 606 for instructions executing at processor 602 tooperate on; the results of previous instructions executed at processor602 for access by subsequent instructions executing at processor 602 orfor writing to memory 604 or storage 606; or other suitable data. Thedata caches may speed up read or write operations by processor 602. TheTLBs may speed up virtual-address translation for processor 602. Inparticular embodiments, processor 602 may include one or more internalregisters for data, instructions, or addresses. This disclosurecontemplates processor 602 including any suitable number of any suitableinternal registers, where appropriate. Where appropriate, processor 602may include one or more arithmetic logic units (ALUs); be a multi-coreprocessor; or include one or more processors 602. Although thisdisclosure describes and illustrates a particular processor, thisdisclosure contemplates any suitable processor.

In particular embodiments, memory 604 includes main memory for storinginstructions for processor 602 to execute or data for processor 602 tooperate on. As an example and not by way of limitation, computer system600 may load instructions from storage 606 or another source (such as,for example, another computer system 600) to memory 604. Processor 602may then load the instructions from memory 604 to an internal registeror internal cache. To execute the instructions, processor 602 mayretrieve the instructions from the internal register or internal cacheand decode them. During or after execution of the instructions,processor 602 may write one or more results (which may be intermediateor final results) to the internal register or internal cache. Processor602 may then write one or more of those results to memory 604. Inparticular embodiments, processor 602 executes only instructions in oneor more internal registers or internal caches or in memory 604 (asopposed to storage 606 or elsewhere) and operates only on data in one ormore internal registers or internal caches or in memory 604 (as opposedto storage 606 or elsewhere). One or more memory buses (which may eachinclude an address bus and a data bus) may couple processor 602 tomemory 604. Bus 612 may include one or more memory buses, as describedbelow. In particular embodiments, one or more memory management units(MMUs) reside between processor 602 and memory 604 and facilitateaccesses to memory 604 requested by processor 602. In particularembodiments, memory 604 includes random access memory (RAM). This RAMmay be volatile memory, where appropriate Where appropriate, this RAMmay be dynamic RAM (DRAM) or static RAM (SRAM). Moreover, whereappropriate, this RAM may be single-ported or multi-ported RAM. Thisdisclosure contemplates any suitable RAM. Memory 604 may include one ormore memories 604, where appropriate. Although this disclosure describesand illustrates particular memory, this disclosure contemplates anysuitable memory.

In particular embodiments, storage 606 includes mass storage for data orinstructions. As an example and not by way of limitation, storage 606may include a hard disk drive (HDD), a floppy disk drive, flash memory,an optical disc, a magneto-optical disc, magnetic tape, or a UniversalSerial Bus (USB) drive or a combination of two or more of these. Storage606 may include removable or non-removable (or fixed) media, whereappropriate. Storage 606 may be internal or external to computer system600, where appropriate. In particular embodiments, storage 606 isnon-volatile, solid-state memory. In particular embodiments, storage 606includes read-only memory (ROM). Where appropriate, this ROM may bemask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM),electrically erasable PROM (EEPROM), electrically alterable ROM (EAROM),or flash memory or a combination of two or more of these. Thisdisclosure contemplates mass storage 606 taking any suitable physicalform. Storage 606 may include one or more storage control unitsfacilitating communication between processor 602 and storage 606, whereappropriate. Where appropriate, storage 606 may include one or morestorages 606. Although this disclosure describes and illustratesparticular storage, this disclosure contemplates any suitable storage.

In particular embodiments, I/O interface 608 includes hardware,software, or both providing one or more interfaces for communicationbetween computer system 600 and one or more I/O devices. Computer system600 may include one or more of these I/O devices, where appropriate. Oneor more of these I/O devices may enable communication between a personand computer system 600. As an example and not by way of limitation, anI/O device may include a keyboard, keypad, microphone, monitor, mouse,printer, scanner, speaker, still camera, stylus, tablet, touch screen,trackball, video camera, another suitable I/O device or a combination oftwo or more of these. An I/O device may include one or more sensors.This disclosure contemplates any suitable I/O devices and any suitableI/O interfaces 608 for them. Where appropriate, I/O interface 608 mayinclude one or more device or software drivers enabling processor 602 todrive one or more of these I/O devices. I/O interface 608 may includeone or more I/O interfaces 608, where appropriate. Although thisdisclosure describes and illustrates a particular I/O interface, thisdisclosure contemplates any suitable I/O interface.

In particular embodiments, communication interface 610 includeshardware, software, or both providing one or more interfaces forcommunication (such as, for example, packet-based communication) betweencomputer system 600 and one or more other computer systems 600 or one ormore networks. As an example and not by way of limitation, communicationinterface 610 may include a network interface controller (NIC) ornetwork adapter for communicating with an Ethernet or other wire-basednetwork or a wireless NIC (WNIC) or wireless adapter for communicatingwith a wireless network, such as a WI-FI network. This disclosurecontemplates any suitable network and any suitable communicationinterface 610 for it. As an example and not by way of limitation,computer system 600 may communicate with an ad hoc network, a personalarea network (PAN), a local area network (LAN), a wide area network(WAN), a metropolitan area network (MAN), or one or more portions of theInternet or a combination of two or more of these. One or more portionsof one or more of these networks may be wired or wireless. As anexample, computer system 600 may communicate with a wireless PAN (WPAN)(such as, for example, a BLUETOOTH WPAN), a WI-FI network, a WI-MAXnetwork, a cellular telephone network (such as, for example, a GlobalSystem for Mobile Communications (GSM) network), or other suitablewireless network or a combination of two or more of these. Computersystem 600 may include any suitable communication interface 610 for anyof these networks, where appropriate. Communication interface 610 mayinclude one or more communication interfaces 610, where appropriate.Although this disclosure describes and illustrates a particularcommunication interface, this disclosure contemplates any suitablecommunication interface.

In particular embodiments, bus 612 includes hardware, software, or bothcoupling components of computer system 600 to each other. As an exampleand not by way of limitation, bus 612 may include an AcceleratedGraphics Port (AGP) or other graphics bus, an Enhanced Industry StandardArchitecture (EISA) bus, a front-side bus (FSB), a HYPERTRANSPORT (HT)interconnect, an Industry Standard Architecture (ISA) bus, an INFINIBANDinterconnect, a low-pin-count (LPC) bus, a memory bus, a Micro ChannelArchitecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, aPCI-Express (PCIe) bus, a serial advanced technology attachment (SATA)bus, a Video Electronics Standards Association local (VLB) bus, oranother suitable bus or a combination of two or more of these. Bus 612may include one or more buses 612, where appropriate. Although thisdisclosure describes and illustrates a particular bus, this disclosurecontemplates any suitable bus or interconnect.

Herein, a computer-readable non-transitory storage medium or media mayinclude one or more semiconductor-based or other integrated circuits(ICs) (such, as for example, field-programmable gate arrays (FPGAs) orapplication-specific ICs (ASICs)), hard disk drives (HDDs), hybrid harddrives (HHDs), optical discs, optical disc drives (ODDs),magneto-optical discs, magneto-optical drives, floppy diskettes, floppydisk drives (FDDs), magnetic tapes, solid-state drives (SSDs),RAM-drives, SECURE DIGITAL cards or drives, any other suitablecomputer-readable non-transitory storage media, or any suitablecombination of two or more of these, where appropriate. Acomputer-readable non-transitory storage medium may be volatile,non-volatile, or a combination of volatile and non-volatile, whereappropriate.

Herein, “or” is inclusive and not exclusive, unless expressly indicatedotherwise or indicated otherwise by context. Therefore, herein, “A or B”means “A, B, or both,” unless expressly indicated otherwise or indicatedotherwise by context. Moreover, “and” is both joint and several, unlessexpressly indicated otherwise or indicated otherwise by context.Therefore, herein, “A and B” means “A and B, jointly or severally,”unless expressly indicated otherwise or indicated otherwise by context.

The scope of this disclosure encompasses all changes, substitutions,variations, alterations, and modifications to the example embodimentsdescribed or illustrated herein that a person having ordinary skill inthe art would comprehend. The scope of this disclosure is not limited tothe example embodiments described or illustrated herein. Moreover,although this disclosure describes and illustrates respectiveembodiments herein as including particular components, elements,functions, operations, or steps, any of these embodiments may includeany combination or permutation of any of the components, elements,functions, operations, or steps described or illustrated anywhere hereinthat a person having ordinary skill in the art would comprehend.Furthermore, reference in the appended claims to an apparatus or systemor a component of an apparatus or system being adapted to, arranged to,capable of, configured to, enabled to, operable to, or operative toperform a particular function encompasses that apparatus, system,component, whether or not it or that particular function is activated,turned on, or unlocked, as long as that apparatus, system, or componentis so adapted, arranged, capable, configured, enabled, operable, oroperative.

What is claimed is:
 1. A method comprising: by a computing device,determining one or more bandwidth constraints on a bandwidth of acommunication channel available to the computing device; by thecomputing device, determining a quantity of data items to transmit fromthe computing device based on a size of the data items and the bandwidthconstraints; by the computing device, ranking each of the data items totransmit based at least in part on an affinity between a user and anoriginator of the data item in a social-networking system and the sizeof the data items, wherein a value of the affinity is based at least inpart on interaction on the social-networking system between the user andthe originator of the data item; by the computing device, selecting,based at least in part on the ranking of the data items, the quantity ofthe data items to transmit from the computing device; and by thecomputing device, writing the selected data items in an order based onthe ranking to a queue for subsequent transmission.
 2. The method ofclaim 1, wherein the selecting comprises selecting one or more of theparticular ones of the data items having an affinity value higher than athreshold value.
 3. The method of claim 2, wherein the threshold valueis based at least in part on one or more of the bandwidth constraints.4. The method of claim 1, further comprising determining an amount ofdata items based at least in part on the bandwidth constraints.
 5. Themethod of claim 1, further comprising: determining a number of datapackets available to transmit based on one or more of the bandwidthconstraints; determining whether an amount of data of one or more of thedata items is less than a payload capacity of one of the data packets;and writing data of a plurality of data items in a particular one of thedata packets based on the determination that an amount of data of one ormore of the data items is less than a payload capacity of one of thedata packets.
 6. The method of claim 1, wherein the ranking each dataitem is further based at least in part on a category assigned to eachdata item.
 7. The method of claim 1, wherein the size of the data itemsis a compressed data size of each data item.
 8. One or morecomputer-readable non-transitory storage media embodying software thatis operable when executed to: determine one or more bandwidthconstraints on a bandwidth of a communication channel available to acomputing device; determine a quantity of data items to transmit fromthe computing device based on a size of the data items and the bandwidthconstraints; rank each of the data items to transmit based at least inpart on an affinity between a user and an originator of the data item ina social-networking system and the size of the data items, wherein avalue of the affinity is based at least in part on interaction on thesocial-networking system between the user and the originator of the dataitem; select, based at least in part on the ranking of the data items,the quantity of the data items to transmit from the computing device;and write the selected data items in an order based on the ranking to aqueue for subsequent transmission.
 9. The media of claim 8, wherein thesoftware is further operable to select one or more of the particularones of the data items having an affinity value higher than a thresholdvalue.
 10. The media of claim 9, wherein the threshold value is based atleast in part on one or more of the bandwidth constraints.
 11. The mediaof claim 8, wherein the software is further configured to: determine anumber of data packets available to transmit based on one or more of thebandwidth constraints; determine whether an amount of data of one ormore of the data items is less than a payload capacity of one of thedata packets; and write data of a plurality of data items in aparticular one of the data packets based on the determination that anamount of data of one or more of the data items is less than a payloadcapacity of one of the data packets.
 12. The media of claim 8, whereinthe ranking each data item is further based at least in part on acategory assigned to each data item.
 13. The media of claim 8, whereinthe size of the data items is a compressed data size of each data item.14. A system comprising: one or more processors; and a memory coupled tothe processors comprising instructions executable by the processors, theprocessors being operable when executing the instructions to: determineone or more bandwidth constraints on a bandwidth of a communicationchannel available to a computing device; determine a quantity of dataitems to transmit from the computing device based on a size of the dataitems and the bandwidth constraints; rank each of the data items totransmit based at least in part on an affinity between a user and anoriginator of the data item in a social-networking system and the sizeof the data items, wherein a value of the affinity is based at least inpart on interaction on the social-networking system between the user andthe originator of the data item; select, based at least in part on theranking of the data items, the quantity of the data items to transmitfrom the computing device; and write the selected data items in an orderbased on the ranking to a queue for subsequent transmission.
 15. Thesystem of claim 14, wherein the software is further operable to selectone or more of the particular ones of the data items having an affinityvalue higher than a threshold value.
 16. The system of claim 15, whereinthe threshold value is based at least in part on one or more of thebandwidth constraints.